<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
        img{
      width: 100px;
      height: 100px;
      display: block;
      /* position: absolute;
      bottom: 100px; */
    }
  </style>
</head>
<body>
  <input type="button" value="淡出" id="btn1">
  <input type="button" value="淡入" id="btn2">
  <input type="button" value="切换" id="btn3">
  <input type="button" value="指定op" id="btn4">
  <img src="../../../2023-1-31/BOMDOM/img/QQ图片20221222111355.jpg" alt="" id="img">
  <script src="../jquery-1.12.4.min.js"></script>
  <script>
    var $btn1 = $("#btn1");
    var $btn2 = $("#btn2");
    var $btn3 = $("#btn3");
    var $btn4 = $("#btn4");
    var $img = $("#img");
    //  绑定点击事件
    // 淡出 淡入

$btn1.click(
  function () {
    $img.fadeOut("slow");
  }
);
$btn2.click(
  function () {
    $img.fadeIn(1000);
  }
);
$btn3.click(
  function () {
    $img.fadeToggle("fast");
  }
);
$btn4.click(
  function () {
    $img.fadeTo(500,0.5);
  }
);
  </script>
</body>
</html>